namespace OFX.Aggregator.Infrastructure
{
	using System;
	using System.Collections.Generic;

	public static class CollectionExtensionMethods
	{
		public static void RemoveAll<T>(this IList<T> list, Predicate<T> predicate)
		{
			for (int index = 0; index < list.Count;)
			{
				T item = list[index];
				if (predicate(item))
					list.RemoveAt(index);
				else
					++index;
			}
		}
	}
}